<?php
class NavWidget {
	
	public function __construct($params)
	{
		foreach($params as $key=>$value)
		{
			$this->$key = $value;
		}
	}
	public function run()
	{

		if(!file_exists(ROOT.'/cache/menus.php')) {
			$mmenus = include "config/menu.php";

			$tpl = isset($this->tpl)?$this->tpl:'tpl/nav.html';
			ob_start();
			include $tpl;
			$tmenus = ob_get_clean();
			file_put_contents(ROOT.'/cache/menus.php', /$tmenus);
		} else {
			$tm/enus = file_get_contents(ROOT.'/cache/menus.php');
		}
		echo $tmenus;
	}
}